/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.order.entity.serviceorder;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.modules.base.entity.cars.Tcar;
import com.jeesite.modules.logistics.entity.ladingbill.LadingBill;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 服务订单Entity
 * @author Kilo
 * @version 2021-03-05
 */
@Table(name="t_service_order_detail", alias="a", columns={
		@Column(name="service_order_detail_id", attrName="serviceOrderDetailId", label="服务订单明细ID", isPK=true),
		@Column(name="row_number", attrName="rowNumber", label="行号"),
		@Column(name="car_id", attrName="carId", label="车辆"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="engine_number", attrName="engineNumber", label="发动机号"),
        @Column(name="color", attrName="color", label="车身颜色"),
        @Column(name="production_date", attrName="productionDate", label="生产日期"),
        @Column(name="factory", attrName="factory", label="原厂地"),
        @Column(name="tire_size", attrName="tireSize", label="轮胎尺寸"),
        @Column(name="seat_number", attrName="seatNumber", label="座位数"),
        @Column(name="milage", attrName="milage", label="里程数"),
		@Column(name="brand", attrName="brand", label="品牌"),
		@Column(name="area", attrName="area", label="版型"),
		@Column(name="model", attrName="model", label="车型"),
		@Column(name="displacement", attrName="displacement", label="排量"),
		@Column(name="energy_type", attrName="energyType", label="能源类型"),
		@Column(name="customs_tariff_rate", attrName="customsTariffRate", label="海关税率"),
		@Column(name="quantity", attrName="quantity", label="数量"),
		@Column(name="unit_price", attrName="unitPrice", label="单价", comment="单价（外币）"),
		@Column(name="amount", attrName="amount", label="车辆总价", comment="车辆总价（外币）"),
		@Column(name="agency_fee", attrName="agencyFee", label="客户代理费", comment="客户代理费（RMB）"),
		@Column(name="risk_margin", attrName="riskMargin", label="客户风险保证金", comment="客户风险保证金（RMB）"),
		@Column(name="pre_pay", attrName="prePay", label="预收费用", comment="预收费用（RMB）"),
		@Column(name="total_cost", attrName="totalCost", label="费用合计", comment="费用合计（RMB）"),
		@Column(name="trading_location", attrName="tradingLocation", label="交货地点"),
		@Column(name="logistics_status", attrName="logisticsStatus", label="物流状态"),
		@Column(name="lock_flag", attrName="lockFlag", label="是否完结锁定"),
		@Column(name="overseas_warehouse_id", attrName="overseasWarehouseId", label="海外仓"),
		@Column(name="service_order_id", attrName="serviceOrderId.serviceOrderId", label="服务订单ID"),
		@Column(name="lading_bill_id", attrName="ladingBillId", label="提单ID"),
		@Column(name="investor_car_contract_id", attrName="investorCarContractId", label="资方汽车供需合同ID"),
		@Column(name="warehouse_id", attrName="warehouseId", label="仓库"),
		@Column(name="tax_clearance_id", attrName="taxClearanceId", label="通关缴税ID"),
		@Column(name="agency_fee1", attrName="agencyFee1", label="资方代理费", comment="资方代理费（RMB）"),
		@Column(name="risk_margin1", attrName="riskMargin1", label="资方风险保证金", comment="资方风险保证金（RMB）"),
	}, joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Tcar.class, attrName="tcar", alias="b",
				on="b.car_id = a.car_id", columns={
				@Column(name="car_id", label="车辆编码", isPK=true),
				@Column(name="car_name", label="车辆名称"),
		}),
	}, orderBy="a.service_order_detail_id ASC"
)
public class ServiceOrderDetail extends DataEntity<ServiceOrderDetail> {

	private static final long serialVersionUID = 1L;
	private String serviceOrderDetailId;		// 服务订单明细ID
	private Long rowNumber;		// 行号
	private String carId;		// 车辆
	private String carName;		// 车辆
	private String frameNumber;		// 车架号
	private String brand;		// 品牌
	private String area;		// 版型
	private String model;		// 车型
	private String displacement;		// 排量
	private String energyType;		// 能源类型
	private String customsTariffRate;		// 海关税率
	private Long quantity;		// 数量
	private Double unitPrice;		// 单价（外币）
	private Double amount;		// 车辆总价（外币）
	private Double agencyFee;		// 客户代理费（RMB）
	private Double riskMargin;		// 客户风险保证金（RMB）
	private Double prePay;		// 预收费用（RMB）
	private Double totalCost;		// 费用合计（RMB）
	private String tradingLocation;		// 交货地点
	private String logisticsStatus;		// 物流状态
	private String lockFlag;		// 是否完结锁定
	private String overseasWarehouseId;		// 海外仓
	private ServiceOrder serviceOrderId;		// 服务订单ID 父类
	private String orderId;
	private String serviceOrderName;
	private String investorCarContractId;
    private Tcar tcar;
	private String engineNumber;  // 发动机号
    private String color;		// 车身颜色
    private Date productionDate;		// 生产日期
    private String factory;		// 原厂地
    private String tireSize;		// 轮胎尺寸
    private String seatNumber;		// 座位数
    private String milage;		// 里程数
    private LadingBill ladingBill;// 提单ID
    private String ladingBillId;
    private String warehouseId;
    private String property;
    private Double actualAmount; // 资方结算明细的实付总金额
    private String taxClearanceId; // 通关缴税ID
	private Double agencyFee1;		// 资方代理费（RMB）
	private Double riskMargin1;		// 资方风险保证金（RMB）

	private String customsDeclarationDetailId;

	public Double getAgencyFee1() {
		return agencyFee1;
	}

	public void setAgencyFee1(Double agencyFee1) {
		this.agencyFee1 = agencyFee1;
	}

	public Double getRiskMargin1() {
		return riskMargin1;
	}

	public void setRiskMargin1(Double riskMargin1) {
		this.riskMargin1 = riskMargin1;
	}

	public String getTaxClearanceId() {
		return taxClearanceId;
	}

	public void setTaxClearanceId(String taxClearanceId) {
		this.taxClearanceId = taxClearanceId;
	}

	public Tcar getTcar() {
		return tcar;
	}

	public void setTcar(Tcar tcar) {
		this.tcar = tcar;
	}

	public ServiceOrderDetail() {
		this(null);
	}


	public ServiceOrderDetail(ServiceOrder serviceOrderId){
		this.serviceOrderId = serviceOrderId;
	}

	public String getServiceOrderDetailId() {
		return serviceOrderDetailId;
	}

	public void setServiceOrderDetailId(String serviceOrderDetailId) {
		this.serviceOrderDetailId = serviceOrderDetailId;
	}

	public Long getRowNumber() {
		return rowNumber;
	}

	public void setRowNumber(Long rowNumber) {
		this.rowNumber = rowNumber;
	}

	@NotBlank(message="车辆不能为空")
	@Length(min=0, max=64, message="车辆长度不能超过 64 个字符")
	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}

	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}

	@Length(min=0, max=2, message="品牌长度不能超过 2 个字符")
	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	@Length(min=0, max=64, message="版型长度不能超过 64 个字符")
	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	@Length(min=0, max=100, message="车型长度不能超过 100 个字符")
	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	@NotBlank(message="排量不能为空")
	@Length(min=0, max=50, message="排量长度不能超过 50 个字符")
	public String getDisplacement() {
		return displacement;
	}

	public void setDisplacement(String displacement) {
		this.displacement = displacement;
	}

	@NotBlank(message="能源类型不能为空")
	@Length(min=0, max=2, message="能源类型长度不能超过 2 个字符")
	public String getEnergyType() {
		return energyType;
	}

	public void setEnergyType(String energyType) {
		this.energyType = energyType;
	}

	@NotBlank(message="海关税率不能为空")
	@Length(min=0, max=10, message="海关税率长度不能超过 10 个字符")
	public String getCustomsTariffRate() {
		return customsTariffRate;
	}

	public void setCustomsTariffRate(String customsTariffRate) {
		this.customsTariffRate = customsTariffRate;
	}

	public Long getQuantity() {
		return quantity;
	}

	public void setQuantity(Long quantity) {
		this.quantity = quantity;
	}

	@NotNull(message="单价不能为空")
	public Double getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(Double unitPrice) {
		this.unitPrice = unitPrice;
	}

	@NotNull(message="车辆总价不能为空")
	public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	public Double getAgencyFee() {
		return agencyFee;
	}

	public void setAgencyFee(Double agencyFee) {
		this.agencyFee = agencyFee;
	}

	public Double getRiskMargin() {
		return riskMargin;
	}

	public void setRiskMargin(Double riskMargin) {
		this.riskMargin = riskMargin;
	}

	public Double getPrePay() {
		return prePay;
	}

	public void setPrePay(Double prePay) {
		this.prePay = prePay;
	}

	public Double getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(Double totalCost) {
		this.totalCost = totalCost;
	}

	@Length(min=0, max=50, message="交货地点长度不能超过 50 个字符")
	public String getTradingLocation() {
		return tradingLocation;
	}

	public void setTradingLocation(String tradingLocation) {
		this.tradingLocation = tradingLocation;
	}

	public String getLogisticsStatus() {
		return logisticsStatus;
	}

	public void setLogisticsStatus(String logisticsStatus) {
		this.logisticsStatus = logisticsStatus;
	}

	public String getLockFlag() {
		return lockFlag;
	}

	public void setLockFlag(String lockFlag) {
		this.lockFlag = lockFlag;
	}

	public ServiceOrder getServiceOrderId() {
		return serviceOrderId;
	}

	public void setServiceOrderId(ServiceOrder serviceOrderId) {
		this.serviceOrderId = serviceOrderId;
	}

    public String getOverseasWarehouseId() {
        return overseasWarehouseId;
    }

    public void setOverseasWarehouseId(String overseasWarehouseId) {
        this.overseasWarehouseId = overseasWarehouseId;
    }

    public String getEngineNumber() {
        return engineNumber;
    }

    public void setEngineNumber(String engineNumber) {
        this.engineNumber = engineNumber;
    }

    public LadingBill getLadingBill() {
        return ladingBill;
    }

    public void setLadingBill(LadingBill ladingBill) {
        this.ladingBill = ladingBill;
    }

    public String getLadingBillId() {
        return ladingBillId;
    }

    public void setLadingBillId(String ladingBillId) {
        this.ladingBillId = ladingBillId;
    }

    public Double getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(Double actualAmount) {
        this.actualAmount = actualAmount;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getInvestorCarContractId() {
        return investorCarContractId;
    }

    public void setInvestorCarContractId(String investorCarContractId) {
        this.investorCarContractId = investorCarContractId;
    }

    public String getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(String warehouseId) {
        this.warehouseId = warehouseId;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

	public String getCustomsDeclarationDetailId() {
		return customsDeclarationDetailId;
	}

	public void setCustomsDeclarationDetailId(String customsDeclarationDetailId) {
		this.customsDeclarationDetailId = customsDeclarationDetailId;
	}

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }

    public String getServiceOrderName() {
        return serviceOrderName;
    }

    public void setServiceOrderName(String serviceOrderName) {
        this.serviceOrderName = serviceOrderName;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Date getProductionDate() {
        return productionDate;
    }

    public void setProductionDate(Date productionDate) {
        this.productionDate = productionDate;
    }

    public String getFactory() {
        return factory;
    }

    public void setFactory(String factory) {
        this.factory = factory;
    }

    public String getTireSize() {
        return tireSize;
    }

    public void setTireSize(String tireSize) {
        this.tireSize = tireSize;
    }

    public String getSeatNumber() {
        return seatNumber;
    }

    public void setSeatNumber(String seatNumber) {
        this.seatNumber = seatNumber;
    }

    public String getMilage() {
        return milage;
    }

    public void setMilage(String milage) {
        this.milage = milage;
    }
}
